﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OWNMonitor
{
    public partial class SettingsForm : Form
    {
        public SettingsForm(string ipAddress, int ipPort, bool monitorOnly)
        {
            InitializeComponent();

            textBoxIpAddr.Text = IpAddress = ipAddress;
            IpPort = ipPort;
            textBoxPort.Text = ipPort.ToString();
            checkBoxMonOnly.Checked = MonitorOnly = monitorOnly;
        }

        public string IpAddress { get; private set; }
        public int IpPort { get; private set; }
        public bool MonitorOnly { get; private set; }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            try
            {
                IpPort = int.Parse(textBoxPort.Text);
                IpAddress = textBoxIpAddr.Text;
                MonitorOnly = checkBoxMonOnly.Checked;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
                return;
            }
        }
    }
}
